Only unset the entry's contents if the entry exists
authorFederico Mena Quintero <federico@gnome.org>
Wed, 27 Jul 2011 22:30:05 +0000 (17:30 -0500)
committerFederico Mena Quintero <federico@gnome.org>
Wed, 27 Jul 2011 23:56:11 +0000 (18:56 -0500)
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkfilechooserdefault.c

index 2952fd85f0f4872e8812e8d46d7ceb12f90a669c..308cd447f1fe44697cd26e80e2594585ed3ce5dd 100644 (file)
@@ -9825,7 +9825,10 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
   gpointer col_data;
   ShortcutType shortcut_type;
 
-  if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY
+  /* In the Save modes, we want to preserve what the uesr typed in the filename
+   * entry, so that he may choose another folder without erasing his typed name.
+   */
+  if (impl->location_entry
       && !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
           || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
     _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");